function HoverMask(dom) {
    this._dom = dom;
    this._shown = false;
    this._parent = this._dom.parent();
}
HoverMask.prototype = {
    show: function(dayDom) {
        if(this._shown){
            return;
        }
        var position = $(dayDom).position();
        var parent_position = this._parent.position();
        this._dom.css('top', position.top - parent_position.top).css('left', position.left - parent_position.left);
        this._setVisibility(this._dom,  'visible');
        this._shown = true;
    },
    hide: function() {
        if(!this._shown){
            return;
        }

        this._shown = false;
        var me = this;
        setTimeout(function(){
          if(me._shown){
            return;
          }
          me._setVisibility(me._dom, 'hidden');
        }, 1)
    },

    _setVisibility: function(dom, value) {
        if (dom.css('visibility') != (value)) {
            dom.css('visibility', value);
        }
    }
};